package com.lz.rocketmq.consumer.project.listener.clustering;

import com.lz.rocketmq.consumer.common.utils.DateUtils;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 */
@Service
@RocketMQMessageListener(consumerGroup = "L1", topic = "market-topic", messageModel = MessageModel.CLUSTERING)
public class ConsumerClusterMarketL1Service implements RocketMQListener<String> {
    private static final Logger logger = LoggerFactory.getLogger(ConsumerClusterMarketL1Service.class);

    public static String t = null;

    @Override
    public void onMessage(String message) {
        System.out.println(String.format("日期: %s Service:%s group: %s topic: %s messageModel:%s msg:%s", DateUtils.getCurr_YYYY_MM_DD_HH_MM_SS_SSS(),"MarketL1", "L1", "market-topic", "集群", message));
    }

}